package com.dai.zhenfujin.visitingcard.activity.marry;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.dai.zhenfujin.R;
import com.dai.zhenfujin.base.BaseActivity;
import com.dai.zhenfujin.visitingcard.adapter.VisitingCardAdapter;
import com.dai.zhenfujin.visitingcard.bean.VisitingCardBean;

import java.util.ArrayList;
import java.util.List;
/*
婚礼
 */
public class WeddingActivity extends BaseActivity implements View.OnClickListener{

    private TextView tvTitleName;
    private ImageView imageView;
    private ListView listView;

    private List<VisitingCardBean> beanList;
    private VisitingCardAdapter adapter;
    private View view;

    private Button btAll,btScheme,btWeddingCar,btWassail,btPhotography,btBridalVeil,btEmcee,btElse;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_wedding);
        view = View.inflate(this,R.layout.wedding_listview_head,null);
         initView();
         initListener();

        beanList = new ArrayList<>();
        for (int  j=0; j<20;j++){
            beanList.add(new VisitingCardBean(
                    "张艺兴","总监","100米","张艺兴工作室集团",
                    "张艺兴工作室","120万起","住宅 | 洪山 | 洪山其他",
                    "光谷广场111号"));
        }
        listView.addHeaderView(view);
        adapter = new VisitingCardAdapter(this,beanList);
        listView.setAdapter(adapter);
        listView.setVerticalScrollBarEnabled(false);


    }

    private void initListener() {
        imageView.setOnClickListener(this);
        btAll.setOnClickListener(this);
        btScheme.setOnClickListener(this);
        btWeddingCar.setOnClickListener(this);
        btWassail.setOnClickListener(this);
        btPhotography.setOnClickListener(this);
        btBridalVeil.setOnClickListener(this);
        btEmcee.setOnClickListener(this);
        btElse.setOnClickListener(this);
    }

    private void initView() {
        tvTitleName = findViewById(R.id.title_textview);
        tvTitleName.setText("婚礼");
        imageView = findViewById(R.id.title_imageview);
        listView = findViewById(R.id.wedding_listview);

        btAll = view.findViewById(R.id.wedding_all);//全部
        btScheme = view.findViewById(R.id.wedding_scheme);//策划
        btWeddingCar  = view.findViewById(R.id.wedding_wedding_car);//婚车
        btWassail = view.findViewById(R.id.wedding_wassail);//酒宴
        btPhotography = view.findViewById(R.id.wedding_photography);//摄影
        btBridalVeil = view.findViewById(R.id.wedding_bridal_veil);//婚纱
        btEmcee = view.findViewById(R.id.wedding_emcee);//司仪
        btElse = view.findViewById(R.id.wedding_else);//其他
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.title_imageview:
                finish();
                break;
            case R.id.wedding_all://全部
                break;
            case R.id.wedding_scheme://策划

                break;
            case R.id.wedding_wedding_car://婚车
                break;
            case R.id.wedding_wassail://酒宴
                break;
            case R.id.wedding_photography://酒宴
                break;
            case R.id.wedding_bridal_veil://婚纱
                break;
            case R.id.wedding_emcee://婚纱
                break;
            case R.id.wedding_else://其他
                break;
        }
    }
}
